#!/usr/bin/env bash

export HISTFILE="$GSH_CONFIG/history"
export HISTSIZE=50000
export HISTFILESIZE=50000

# do not save consecutive duplicates in the history
export HISTCONTROL="ignoredups"
export HISTIGNORE=""

# clear "host" history
if ! [ -s "$HISTFILE" ]
then
  history -c
  . gsh_gettext.sh
  history -s "# $(gettext "START OF COMMANDS HISTORY")"
fi

# expand aliases even in non-interactive shells (when invoked with -c for
# example)
shopt -s expand_aliases

# completion for (some) gsh commands
complete -W 'check exit goal help index log reset resetstatic stat version welcome' gsh

# print message when player wanders outside GameShell filesystem
PROMPT_COMMAND[0]=_check_pwd
PROMPT_COMMAND[1]=_help_hint
